package com.start.config;

import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import;

import com.start.bean.BookDao;
import com.start.bean.ImportSelectorTest;
import com.start.bean.Person;
import com.start.bean.RegisterBeanDefinitionsTest;

//配置类 == 配置文件XML
@Configuration

// 自动扫描组件注解
// @ComponentScan(basePackages = { "com.start" }, useDefaultFilters = false,
// includeFilters = {
// @Filter(type = FilterType.ANNOTATION, value = { Repository.class,
// Service.class}) })
// @ComponentScan(basePackages = { "com.start" },
// includeFilters = {@Filter(type = FilterType.CUSTOM, value =
// {MyTypeFilter.class})})

// @Import(ImportSelectorTest.class)
// @Import( RegisterBeanDefinitionsTest.class)
// @Import({BookDao.class, RegisterBeanDefinitionsTest.class})
public class MainConfig {

	/**
	 * @Conditional:判断是否要加载该Bean。
	 */
	// @Conditional(value = { WindowCondition.class })
	// @Bean
	// public Person person03() {
	// return new Person("beijing", 1996);
	// }

	/**
	 * 懒加载和作用域
	 * 
	 * @return
	 */
	// @Lazy
	// @Scope(value = "singleton")
	// @Bean
	// public Person person02() {
	// return new Person("wwj", 10);
	// }

	/**
	 * 简单使用
	 */
	// 给容器中注册一个Bean；类型为返回值的类型；id默认是使用方法名作为id；
	// @Bean(name = "person")
	// public Person person01() {
	// return new Person("wwj", 10);
	// }

}
